/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Juanan
 */
@Entity
@Table(name = "con_country")
@NamedQueries(
{
    @NamedQuery(name = "ConCountry.findAll", query = "SELECT c FROM ConCountry c")
})
public class ConCountry implements Serializable
{
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "CON_ID")
    private Integer conId;
    @Column(name = "CON_CODE")
    private String conCode;
    @Column(name = "CON_NAME")
    private String conName;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "conId")
    private Collection<CitCity> citCityCollection;

    public ConCountry()
    {
    }

    public ConCountry(Integer conId)
    {
        this.conId = conId;
    }

    public Integer getConId()
    {
        return conId;
    }

    public void setConId(Integer conId)
    {
        this.conId = conId;
    }

    public String getConCode()
    {
        return conCode;
    }

    public void setConCode(String conCode)
    {
        this.conCode = conCode;
    }

    public String getConName()
    {
        return conName;
    }

    public void setConName(String conName)
    {
        this.conName = conName;
    }

    public Collection<CitCity> getCitCityCollection()
    {
        return citCityCollection;
    }

    public void setCitCityCollection(Collection<CitCity> citCityCollection)
    {
        this.citCityCollection = citCityCollection;
    }

    @Override
    public int hashCode()
    {
        int hash = 0;
        hash += (conId != null ? conId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object)
    {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ConCountry))
        {
            return false;
        }
        ConCountry other = (ConCountry) object;
        if ((this.conId == null && other.conId != null) || (this.conId != null && !this.conId.equals(other.conId)))
        {
            return false;
        }
        return true;
    }

    @Override
    public String toString()
    {
        return "entities.ConCountry[ conId=" + conId + " ]";
    }
    
}
